<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});

Route::get('/',function(){
   return view('welcome'); 
});


//基本路由
//Route::get('/',function(){
//   return "Hello Laravel"; 
//});

//普通路由
 Route::get('/hello',function(){
    return "Hello World!生成url地址：".url("/aa"); 
 });
 
 
 //带参数路由 必选路由
 Route::get('name/{id}',function($id){
     return 'lamp149'.$id;
 });
 
 
 //带可选参数路由
Route::get('/demo1/{id?}',function($id=0){
    return "参数id值".$id;
});


//配置访问控制器的配置
Route::get('/hello2',"HelloController@aaa");
Route::get('/demo2/add',"DemoController@add");

//RESTfull路由的配置
Route::resource("stu","StuController");

//文件上传路由配置
Route::get('/upload',function(){
   return view('upload'); 
});
Route::post('/doupload','DemoController@doUpload');

//响应测试路由配置
Route::get('/response', "DemoController@response");


//视图实例配置
Route::get('/view','DemoController@view');


//相册管理路由的配置
Route::resource("photo","PhotosController");